package com.groot.medical.service;

import com.groot.medical.dao.PaySettingDAO;
import com.groot.medical.dao.PaySettingDAOImpl;
import com.groot.medical.entity.PageBean;
import com.groot.medical.entity.PaySetting;

public class PaySettingServiceImpl implements PaySettingService {
	private PaySettingDAO paySettingDAO = new PaySettingDAOImpl();

	@Override
	public PageBean findPaySettingListByPage(int pageNum, int pageSize) {
		//查出记录总条数
		int totalRecord = paySettingDAO.getAllCounts();
		PageBean pageBean = new PageBean<>(pageNum, pageSize, totalRecord);
		int startIndex = pageBean.getStartIndex();
		pageBean.setList(paySettingDAO.findPaySettingListByPage(startIndex,pageSize));
		return pageBean;
	}

	@Override
	public void addPaySettingInfo(PaySetting paysetting) {
		paySettingDAO.addPaySettingInfo(paysetting);
		
	}

	@Override
	public PaySetting checkInPayTime(String years,String nowTime) {
		PaySetting paySetting = paySettingDAO.checkInPayTime(nowTime,years);
		return paySetting;
	}

	@Override
	public String findMoneyByCurrentYear(String nowTime) {
		// TODO Auto-generated method stub
		return paySettingDAO.findMoneyByCurrentYear(nowTime);
	}

	@Override
	public PaySetting findPaySettingByYear(String year) {
		PaySetting paySetting = paySettingDAO.findPaySettingByYear(year);
		return paySetting;
	}

	@Override
	public void editPaySettingInfo(PaySetting paysetting) {
		paySettingDAO.editPaySettingInfo(paysetting);
		
	}
	

}
